home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / news.h < prev    next >
C/C++ Source or Header  |  1994-09-13  |  6KB  |  134 lines

  1. /*
  2.  * Program:    Netnews mail routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    4 September 1991
  13.  * Last Edited:    12 September 1994
  14.  *
  15.  * Copyright 1994 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Command bits from news_getflags() */
  37.  
  38. #define fSEEN 1
  39. #define fDELETED 2
  40. #define fFLAGGED 4
  41. #define fANSWERED 8
  42.  
  43.  
  44. /* NEWS I/O stream local data */
  45.     
  46. typedef struct news_local {
  47.   unsigned int dirty : 1;    /* disk copy of .newsrc needs updating */
  48.   char *dir;            /* spool directory name */
  49.   char *name;            /* local mailbox name */
  50.   char *buf;            /* temporary buffer */
  51.   unsigned long buflen;        /* current size of temporary buffer */
  52.   unsigned long *number;    /* news message numbers */
  53.   char **header;        /* message headers */
  54.   char **body;            /* message bodies */
  55. } NEWSLOCAL;
  56.  
  57.  
  58. /* Convenient access to local data */
  59.  
  60. #define LOCAL ((NEWSLOCAL *) stream->local)
  61.  
  62. /* Function prototypes */
  63.  
  64. DRIVER *news_valid (char *name);
  65. void *news_parameters (long function,void *value);
  66. void news_find (MAILSTREAM *stream,char *pat);
  67. void news_find_bboards (MAILSTREAM *stream,char *pat);
  68. void news_find_all (MAILSTREAM *stream,char *pat);
  69. void news_find_all_bboards (MAILSTREAM *stream,char *pat);
  70. long news_subscribe (MAILSTREAM *stream,char *mailbox);
  71. long news_unsubscribe (MAILSTREAM *stream,char *mailbox);
  72. long news_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  73. long news_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  74. long news_create (MAILSTREAM *stream,char *mailbox);
  75. long news_delete (MAILSTREAM *stream,char *mailbox);
  76. long news_rename (MAILSTREAM *stream,char *old,char *new);
  77. MAILSTREAM *news_open (MAILSTREAM *stream);
  78. int news_select (struct direct *name);
  79. int news_numsort (struct direct **d1,struct direct **d2);
  80. void news_close (MAILSTREAM *stream);
  81. void news_fetchfast (MAILSTREAM *stream,char *sequence);
  82. void news_fetchflags (MAILSTREAM *stream,char *sequence);
  83. ENVELOPE *news_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  84. char *news_fetchheader (MAILSTREAM *stream,long msgno);
  85. char *news_fetchtext (MAILSTREAM *stream,long msgno);
  86. char *news_fetchbody (MAILSTREAM *stream,long m,char *s,unsigned long *len);
  87. void news_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  88. void news_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  89. void news_search (MAILSTREAM *stream,char *criteria);
  90. long news_ping (MAILSTREAM *stream);
  91. void news_check (MAILSTREAM *stream);
  92. void news_expunge (MAILSTREAM *stream);
  93. long news_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  94. long news_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  95. long news_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  96.           STRING *message);
  97. void news_gc (MAILSTREAM *stream,long gcflags);
  98. short news_getflags (MAILSTREAM *stream,char *flag);
  99. char news_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  100. char news_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  101. char news_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  102. char news_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  103. char news_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  104. char news_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  105. char news_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  106. char news_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  107. char news_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  108. char news_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  109. char news_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  110. char news_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  111. char news_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  112. char news_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  113. char news_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  114. char news_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  115. char news_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  116. unsigned long news_msgdate (MAILSTREAM *stream,long msgno);
  117. char news_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  118. char news_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  119. char news_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  120. char news_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char news_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char news_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char news_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  124. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  125. search_t news_search_date (search_t f,long *n);
  126. search_t news_search_flag (search_t f,char **d);
  127. search_t news_search_string (search_t f,char **d,long *n);
  128.  
  129. /* This is embarassing */
  130.  
  131. extern char *bezerk_file (char *dst,char *name);
  132. extern int bezerk_lock (char *file,int flags,int mode,char *lock,int op);
  133. extern void bezerk_unlock (int fd,MAILSTREAM *stream,char *lock);
  134.